package com.grid.entity;


import java.io.*;
import java.util.HashMap;
import java.util.Map;


public class test {
    public static void main(String[] args) throws FileNotFoundException, IOException {
        File file = new File("grid.txt");
        try {
            if (!file.exists() || file.length() == 0) {
                System.out.println("Data file missing or empty");
                file.createNewFile();
            }
            FileOutputStream fos = new FileOutputStream(file);
            ObjectOutputStream oos = new ObjectOutputStream(fos);
            Map<String,Grid> gridMap = new HashMap<>();
            gridMap.put("1",new Grid("1","1","1"));
            System.out.println(gridMap.size());
            oos.writeObject(gridMap);
            oos.close();
        } catch (IOException e) {
            System.err.println("Error loading data or FXML");
            e.printStackTrace();
        }
    }
}
